package com.controller.backend;

import com.biz.ExamineeRecordBiz;
import com.core.Result;
import com.core.ResultGenerator;
import com.entity.model.ExamineeRecord;
import com.github.pagehelper.PageInfo;
import com.util.webpage.PageData;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import tk.mybatis.mapper.entity.Condition;

import javax.servlet.http.HttpServletRequest;
import java.util.List;


/**
 * Created by jc on 2023/03/14.
 */
@Controller
@RequestMapping("/backend/security/examineeRecord")
public class ExamineeRecordController extends BaseController<ExamineeRecord> {
    @Autowired
    private ExamineeRecordBiz examineeRecordBiz;

    @RequestMapping(value = "index")
    public String index() throws Exception {
        return "/backend/security/examineeRecord/list";
    }

    @RequestMapping(value = "detail")
    public String detail() throws Exception {
        return "/backend/security/examineeRecord/form";
    }

    @RequestMapping(value = "/examineeList")
    @ResponseBody
    public Result examineeList(Integer id) {
        Condition condition = new Condition(ExamineeRecord.class);
        condition.createCriteria().andEqualTo("examineeId", id);
        List<ExamineeRecord> examineeRecords = examineeRecordBiz.findByCondition(condition);
        return ResultGenerator.genSuccessResult(examineeRecords, examineeRecords.size());
    }
}
